package com.aaa.newpeculiarity8.demo06;

import java.util.function.Function;

/**
 * @author C-Q
 * @version 1.1.0
 * @Description: FunCation<T,R> 函数型函数式接口
 * @date 2022/11/3
 */
public class FunCationTest {
    /*T:参数的泛型
    R:返回值的泛型
    R apply(T t);*/
    public static void main(String[] args) {
        Function<String,Integer> f=t->t.length();
        fan(f,"Hello world");
    }
    public static void fan(Function<String,Integer> f,String str){
        Integer apply = f.apply(str);
        System.out.println(apply);
    }
}
